/*
 * Copyright 2008 Nathan C Jones
 * 
 * This file is part of Fivehundred.
 * 
 * Fivehundred is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * Fivehundred is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * Fivehundred. If not, see <http://www.gnu.org/licenses/>. 
 */

package com.googlecode.fivehundred.model;

/**
 * The face value of a card.
 * 
 * @author Nathan C Jones
 */
public enum Face {

	Ace,

	Two,

	Three,

	Four,

	Five,

	Six,

	Seven,

	Eight,

	Nine,

	Ten,

	Jack,

	Queen,

	King,

	Joker;

	private static final Face[] STANDARD_FACES = new Face[] { Ace, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King };

	/**
	 * <p>
	 * Get the number associated with the face value. The numbers for each face
	 * are:
	 * </p>
	 * <ul>
	 * <li>Ace: 1</li>
	 * <li>Jack: 11</li>
	 * <li>Queen: 12</li>
	 * <li>King: 13</li>
	 * <li>Joker: 14</li>
	 * <li>All other cards have a number matching their face name (eg. Two: 2;
	 * Three: 3)</li>
	 * </ul>
	 * 
	 * @return the number associated with the card face.
	 */
	public int getNumber() {
		return ordinal() + 1;
	}

	/**
	 * @return all the face values excluding the joker.
	 */
	public static Face[] standardFaces() {
		return STANDARD_FACES;
	}

}
